<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>后台</title>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>
<link rel="stylesheet" href="<%=basePath%>css/top.css" />
<link rel="stylesheet"
	href="framework/bootstrap-3.0.0/css/bootstrap.css">
<link rel="stylesheet"
	href="framework/bootstrap-3.0.0/css/bootstrap-theme.css">
<link
	href="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.css"
	rel="stylesheet" type="text/css" />
<script src="<%=basePath%>common/plugins/jQuery/jQuery-2.1.3.min.js"></script>
<script
	src="<%=basePath%>common/plugins/datatables/jquery.dataTables.js"
	type="text/javascript"></script>
<script
	src="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.js"
	type="text/javascript"></script>
</head>

<body>
	<div style="top:0px;"><jsp:include page="aa.jsp"></jsp:include></div>
	<!-- Content Wrapper. Contains page content -->
	<div class="">
		<!-- Content Header (Page header) -->
		<section class="content-header">
		<h1>
			<ol class="breadcrumb">

				<li>案例列表信息</li>
			</ol>
		</h1>


		</section>

		<!-- Main content -->
		<section class="content"> <a
			href="<%=basePath%>admin/addcase.jsp" style="margin-right:0px;"><button
				class="btn  btn-info btn-xs info" style="width:80px;">添加</button>
		</a>
		<div class="row">
			<div class="col-xs-12">

				<div class="box">

					<div class="box-body">

						<table id="example2" class="table table-bordered table-hover">
							<thead>
								<tr>
									<th>编号</th>
									<th>标题</th>
									<th>操作</th>

								</tr>
							</thead>
							<tbody>
								<c:forEach items="${show}" var="pic">
									<tr>

										<td>${pic.id }</td>
										<td><a href="<%=basePath%>caseinfo.do?id=${pic.id}">${pic.title
												}</a>
										</td>

										<td>
											<button onclick="show(${pic.id})"
												class="btn  btn-info btn-xs info" style="width: 50px;">
												查看</button>
											<button onclick="pub(${pic.id})"
												class="btn  btn-info btn-xs info" style="width: 50px;">
												发布</button>
											<button onclick="del(${pic.id})"
												class="btn  btn-info btn-xs info" style="width:50px;">
												删除</button>
										</td>
									</tr>

								</c:forEach>


							</tbody>
						</table>

						<!-- 翻页 -->

					</div>
					<!-- /.box-body -->
				</div>
				<!-- /.box -->


			</div>
			<!-- /.col -->
		</div>
		<!-- /.row --> </section>
		<!-- /.content -->
	</div>
	<!-- /.content-wrapper -->


	</div>
	<!-- ./wrapper -->
	<script type="text/javascript">
	$("#example2").dataTable({
		 	"bPaginate": true, // 翻页功能
			"bLengthChange": false, // 改变每页显示数据数量
			"bFilter": false, // 过滤功能
			"bSort": false, // 排序功能
			"bInfo": true, // 页脚信息
			"oLanguage" : {
                "sLengthMenu" : "每页显示_MENU_条记录",
                "sZeroRecords" : "抱歉， 没有找到记录",
                "sInfo" : "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty" : "没有数据",
                "sInfoFiltered" : "(从 _MAX_ 条数据中检索)",
                "oPaginate" : {
                    "sFirst" : "首页",
                    "sPrevious" : "前一页",
                    "sNext" : "后一页",
                    "sLast" : "尾页"
                },
                "sZeroRecords" : "没有检索到数据",
                "sProcessing" : "正在加载中..."
            },
			"bAutoWidth": true, // 自动宽度
		});	
     function del(id) {
	  location.href= "<%=basePath%>delcase.do?id="+id; 
	  }
	  function pub(id) {
	  	location.href= "<%=basePath%>pubcase.do?id="+id; 
	  }
	  function show(id) {
	  	location.href= "<%=basePath%>caseinfo.do?id="+id; 
	  }
	</script>
</body>
</html>
